};
-mwAddOnloadHook( function(){
+js2AddOnloadHook( function(){
mwEditPageHelper.init();
});
var mwEditPageHelper = {
+++ /dev/null
-<?php
-if($_FILES){
- print "file uploaded oky:<pre>";
- print_r($_FILES);
- print "</pre>";
- die();
-}
-?>
-
-<!DOCTYPE HTML>
-<html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
- <title>Firefogg - Make Ogg Video in your Browser</title>
- <script type="text/javascript" src="../mv_embed.js?debug=true"></script>
-<style type="text/css" media="all">@import "http://www.firefogg.org/css/style.css";</style>
-<style type="text/css" media="all">
-.install{
-display:none;
-}
-input{
-font-size:110%;
-}
-</style>
-<script type="text/javascript">
-mwAddOnloadHook(function(){
- $j('#fogg-file').firefogg();
-});
-</script>
-</head><body>
-<div id="main">
- <h1>Rewrite Form example</h1>
-<br><br><br>
-<center>
- <div style="width:500px">
- <!-- we submit it to ourselves (ie do nothing) -->
- <form action="Firefogg_ReWriteForm.php" method="POST" enctype='multipart/form-data'>
- <table>
- <tr><td>
- Video Name:</td><td> <input type="text" name="fname" /></td>
- </tr>
- <tr>
- <td>Video File :</td><td> <input type="file" name="fogg-file" id="fogg-file"/></td>
- </tr>
- <tr>
- <td>
- <input type="submit" value="Submit" />
- </td>
- </tr>
- </table>
- </form>
- <br><br>
- </div>
-</center>
-</body></html>
"cc_pd_title": "Public Domain",
"unknown_license": "Unknown License",
"no_import_by_url": "This User or Wiki <b>can not</b> import assets from remote URLs. </p><p> Do you need to Login? </p><p> If permissions are set you may have to enable $wgAllowCopyUploads, <a href=\"http://www.mediawiki.org/wiki/Manual:$wgAllowCopyUploads\">more info</a></p>",
- "results_from": "Results from <a href=\"$1\" target=\"_new\" >$2</a>"
+ "results_from": "Results from <a href=\"$1\" target=\"_new\" >$2</a>",
+
+ "missing_desc_see_soruce": "This Asset is missing a description. Please see the [$1 orginal source] and help describe it"
});
var default_remote_search_options = {
'profile':'mediawiki_edit',
//@@todo should query wgForeignFileRepos setting maybe interwikimap from the api
*/
'this_wiki':{
- 'enabled': 0,
- 'checked': 0,
+ 'enabled': 1,
+ 'checked': 1,
'title' : 'This Wiki',
'desc' : '(should be updated with the proper text) maybe import from some config value',
'api_url': wgServer + wgScriptPath + '/api.php',
var overflow_style = ( mediaType =='video' )?'':'overflow:auto;';
//append to the top level of model window:
$j( _this.target_container ).append('<div id="rsd_resource_edit" '+
- 'style="position:absolute;top:0px;left:0px;bottom:85px;right:4px;background-color:#FFF;">' +
+ 'style="position:absolute;top:0px;left:0px;bottom:75px;right:4px;background-color:#FFF;">' +
'<div id="clip_edit_disp" style="position:absolute;' + overflow_style + 'width:100%;height:100%;padding:5px;'+
'width:' + (maxWidth) + 'px;" >' +
mv_get_loading_img('position:absolute;top:30px;left:30px') +
rObj.pSobj.updateDataForImport( rObj );
//setup the resource description from resource description:
- var wt = '{{Information '+"\n"+
- '|Description= ' + rObj.pSobj.getImportResourceDescWiki( rObj );
+ var wt = '{{Information '+"\n";
+
+ if( rObj.desc ){
+ wt += '|Description= ' + rObj.desc + "\n";
+ }else{
+ wt += '|Description= ' + gM('missing_desc_see_soruce', rObj.link ) + "\n";
+ }
+
//output person and bill info if
- wt+='|Source=' + '[' + $j.trim( rObj.link ) + ' Original Source]'+ "\n";
+ wt+='|Source=' + rObj.pSobj.getImportResourceDescWiki( rObj ) + "\n";
if( rObj.author )
wt+='|Author=' + rObj.author +"\n";
//base remote search obj
+loadGM({
+ "imported_from" : "$1 imported from [$2 $3]. See the original [$4 resource page] for more info"
+})
// @key is name of rObj variable
// @value is where to find the value in the item xml
//
}
if( node!=null && attr_name != null){
if(typeof attr_name == 'string'){
- tag_val = $j.trim( $j(node).attr( attr_name ) );
+ tag_val = $j.trim( $j( node ).attr( attr_name ) );
}else{
var attr_vals = {};
for(var j in attr_name){
- if( $j(node).attr( attr_name[j]).length != 0)
+ if( $j(node).attr( attr_name[j] ).length != 0)
attr_vals[ attr_name[j] ] = $j.trim( $j(node).attr( attr_name[j]) ).replace(/(<([^>]+)>)/ig,"");
}
tag_val = attr_vals ;
},
getImportResourceDescWiki:function(rObj){
- return rObj.title + ' imported from ' + '[' + this.cp.homepage +
- ' ' + this.cp.title+']';
+ return gM('imported_from', [rObj.title, this.cp.homepage, this.cp.title, rObj.link]);
},
//for thigns like categories and the like
getExtraResourceDescWiki:function( rObj ){
'categories':page.categories
}
}
+ //attempt to parse out some stuff from the teplate:
+ var desc = this.resultsObj[page_id].desc.match(/\|Description=(([^\n]*\n)*)\|Source=/)
+ if( desc && desc[1] ){
+ this.resultsObj[page_id].desc = $j.trim( desc[1] );
+ }
+
+
//likely a audio clip if no poster and type application/ogg
//@@todo we should return audio/ogg for the mime type or some other way to specify its "audio"
return '{{PD-USGov}}';
},
getExtraResourceDescWiki:function( rObj ){
- var o = '';
+ var o = "\n";
//check for person
if( rObj.person && rObj.person['label'])
o += '* featuring [[' + rObj.person['label'] + ']]' + "\n";
this.onReadyEvents.push(fn);
},
//checks the jQuery flag (this way when remote embeding we don't load jQuery
- // unless mwAddOnloadHook was used or there is video on the page
+ // unless js2AddOnloadHook was used or there is video on the page
runQuededFunctions:function(){
var _this = this;
this.doneReadyEvents=true;
mvJsLoader.runQuededFunctions();
}
}
-//mwAddOnloadHook: ensure jQuery and the DOM are ready:
-function mwAddOnloadHook( func ) {
+//js2AddOnloadHook: ensure jQuery and the DOM are ready:
+function js2AddOnloadHook( func ) {
//make sure the skin/style sheets are avaliable always:
loadExternalCss( mv_jquery_skin_path + 'jquery-ui-1.7.1.custom.css' );
loadExternalCss( mv_embed_path + 'skins/'+mv_skin_name+'/styles.css');
func();
});
}else{
- //if using mwAddOnloadHook we need to get jQuery into place (if its not already included)
+ //if using js2AddOnloadHook we need to get jQuery into place (if its not already included)
mvJsLoader.jQueryCheckFlag = true;
mvJsLoader.addLoadEvent( func );
};
}
+//depreciated mwAddOnloadHook in favor of js2 naming (for clear seperation of js2 code from old mw code
+var mwAddOnloadHook = js2AddOnloadHook;
/*
* this function allows for targeted rewriting
*/
'fogg-preset-custom' => 'Custom Settings',
/*
- * js file: /libAddMedia/mediaWikiUploadHelper.OFF.js
+ * js file: /libAddMedia/searchLibs/metavidSearch.js
*/
- 'upload-enable-converter' => 'Enable video converter (to upload source video not yet converted to theora format) <a href="http://commons.wikimedia.org/wiki/Commons:Firefogg">more info</a>',
- 'upload-fogg_not_installed' => 'If you want to upload video consider installing <a href="http://firefogg.org">firefogg.org</a>, <a href="http://commons.wikimedia.org/wiki/Commons:Firefogg">more info</a>',
- 'upload-transcode-in-progress' => 'Doing Transcode & Upload (do not close this window)',
- 'upload-in-progress' => 'Upload in Progress (do not close this window)',
- 'upload-transcoded-status' => 'Transcoded',
- 'uploaded-status' => 'Uploaded',
- 'upload-select-file' => 'Select File...',
- 'wgfogg_wrong_version' => 'You have firefogg installed but its outdated, <a href="http://firefogg.org">please upgrade</a> ',
- 'wgfogg_waring_ogg_upload' => 'You have selected an ogg file for conversion to ogg (this is probably unnessesary). Maybe disable the video converter?',
- 'wgfogg_waring_bad_extension' => 'You have selected a file with an unsuported extension. <a href="http://commons.wikimedia.org/wiki/Commons:Firefogg#Supported_File_Types">More help</a>',
- 'upload-stats-fileprogres' => '$1 of $2',
- 'mv_upload_done' => 'Your upload <i>should be</i> accessible <a href="$1">here</a>',
- 'upload-unknown-size' => 'Unknown size',
- 'successfulupload' => 'Successful upload',
- 'uploaderror' => 'Upload error',
- 'uploadwarning' => 'Upload warning',
- 'unknown-error' => 'Unknown Error',
- 'return-to-form' => 'Return to form',
- 'file-exists-duplicate' => 'This file is a duplicate of the following file',
- 'fileexists' => 'A file with this name exists already, please check <b><tt>$1</tt></b> if you are not sure if you want to change it.',
- 'fileexists-thumb' => '<center><b>Existing file</b></center>',
- 'ignorewarning' => 'Ignore warning and save file anyway',
- 'file-thumbnail-no' => 'The filename begins with <b><tt>$1</tt></b>',
+ 'mv_stream_title' => '$1 $2 to $3',
/*
- * js file: /libAddMedia/searchLibs/metavidSearch.js
+ * js file: /libAddMedia/searchLibs/baseRemoteSearch.js
*/
- 'mv_stream_title' => '$1 $2 to $3',
+ 'imported_from' => '$1 imported from [$2 $3]. See the original [$4 resource page] for more info',
/*
* js file: /libAddMedia/mvFirefogg.js
'unknown_license' => 'Unknown License',
'no_import_by_url' => 'This User or Wiki <b>can not</b> import assets from remote URLs. </p><p> Do you need to Login? </p><p> If permissions are set you may have to enable $wgAllowCopyUploads, <a href="http://www.mediawiki.org/wiki/Manual:$wgAllowCopyUploads">more info</a></p>',
'results_from' => 'Results from <a href="$1" target="_new" >$2</a>',
+ 'missing_desc_see_soruce' => 'This Asset is missing a description. Please see the [$1 orginal source] and help describe it',
/*
* js file: /libSequencer/mvSequencer.js
* uploadPage.js to be run on specialUpload page.
* controls the invocation of the mvUploader class based on local config.
*/
-mwAddOnloadHook( function(){
+js2AddOnloadHook( function(){
mwUploadHelper.init();
});
//set up the upoload form bindings once all dom manipluation is done